package com.zx.config;/**
 * Author:JasonZ
 * Data:2023/4/17
 */

import com.alibaba.cloud.seata.web.SeataHandlerInterceptor;
import com.zx.filter.AccessInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: ecommerce-parent
 *
 * @description:
 *
 * @author: JasonZ
 *
 * @create: 2023-04-17 16:47
 **/
@Configuration
public class WebConfig {
    @Bean
    WebMvcConfigurer webMvcConfigurer(){
        return new WebMvcConfigurer() {
            @Override
            public void addInterceptors(InterceptorRegistry registry) {
                registry.addInterceptor(new AccessInterceptor());
                registry.addInterceptor(new SeataHandlerInterceptor());
            }
        };
    }
}
